<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="scripts/jquery.min.js"></script>
    </head>
    <body>
        <input type="checkbox" id="cb1"/>
        <div style="display:none">
            <input type="checkbox" id="cb2"/>
        </div>
        <script type="text/javascript">
            //使用setAttribute方法改变元素的属性会体现到代码中
            var cbx1 = document.getElementById("cb1");
            cbx1.setAttribute("checked", true);
            
             //var cbx2 = document.getElementById("cb2");
            //cbx2.setAttribute("checked", true);
            
            //使用Jquery的attr方法修改元素不会体现到具体的DOM代码中
            $("#cb1").attr("checked",false); 
            $("#cb2").attr("checked",true);
        </script>
    </body>
</html>
